package com.ow.dva.module.city.service.impl;

import com.ow.dva.config.annotation.DvaCache5M;
import com.ow.dva.module.base.entity.param.DvaPage;
import com.ow.dva.module.base.service.impl.DvaServiceImpl;
import com.ow.dva.module.city.entity.City;
import com.ow.dva.module.city.mapper.CityMapper;
import com.ow.dva.module.city.service.CityService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 地区信息 服务实现类
 * </p>
 *
 * @author YanZengBao
 * @since 2020-02-20
 * @version V1.0
 */
@Service
public class CityServiceImpl extends DvaServiceImpl<CityMapper, City> implements CityService {

    @DvaCache5M
    @Override
    public DvaPage<City> page(DvaPage<City> page, Map<String, Object> param) {

        return baseMapper.page(page,param);
    }

    @Override
    public List<City> selectProvince() {
        return baseMapper.selectProvince();
    }

    @Override
    public List<City> findChildByCityId(String cityId) {
        return baseMapper.findChildByCityId(cityId);
    }

    @Override
    public List<City> findCityByParentId(String parentId) {
        return baseMapper.findCityByParentId(parentId);
    }

    @Override
    public List<City> findCountyByParentId(String parentId) {
        return baseMapper.findCountyByParentId(parentId);
    }
}
